Skip to content

Conversation

nevans
Copy link
Collaborator

@nevans nevans commented Jun 11, 2025

This adds:

  • ruby script for measuring memory usage with ObjectSpace.memsize_of
  • benchmark-driver scripts for:
    • .new (indirectly via ::[])
    • #slice (aka #[])
    • various set ops: &, |, -, ^, ~
    • various set predicates: #intersect?, #disjoint?, #cover?
  • benchmark-driver scripts for alternate implementations of:
    • AND — #& and #intersect!
    • NOT — #~ and #complement!
    • XOR — #^ and #xor!

🚧 TODO in future PRs:

  • Add benchmark for #find_index
  • Add benchmark for #ordered_at
  • Add benchmark for #find_ordered_index
  • Replace methods with faster implementations

@nevans nevans force-pushed the sequence_set/benchmarks branch from 8bb9e20 to 45bbc9b Compare June 11, 2025 17:48
@nevans nevans force-pushed the sequence_set/benchmarks branch 2 times, most recently from 023100b to 5f2a563 Compare June 18, 2025 14:11
@nevans nevans force-pushed the sequence_set/benchmarks branch from 5f2a563 to e146c40 Compare July 1, 2025 14:21
@nevans nevans force-pushed the sequence_set/benchmarks branch 2 times, most recently from 5132e01 to 27629ba Compare July 14, 2025 20:04
This adds:
* a simple ruby script for measuring `ObjectSpace.memsize_of`,
* several benchmark-driver scripts for:
  * `SequenceSet.new` (via `::[]`, which also calls `#freeze`)
  * `SequenceSet#slice` (aka `#[]`)
  * `SequenceSet#normalize`
  * Various set ops: `&`, `|`, `-`, `^`, `~`
  * Various set predicates: `#intersect?`, `#disjoint?`, `#cover?`
  * Several alternate implementations of:
    * AND — `#&` and `#intersect!`
    * NOT — `#~` and `#complement!`
    * XOR — `#^` and `#xor!`
@nevans nevans force-pushed the sequence_set/benchmarks branch from 27629ba to 3e7565f Compare July 23, 2025 15:35
@nevans nevans merged commit 6747838 into master Jul 23, 2025
37 checks passed
@nevans nevans deleted the sequence_set/benchmarks branch July 23, 2025 15:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant